package com.a85.wxhelper.util;

import android.database.Cursor;
import android.util.Log;

import com.a85.wxhelper.bean.ContactInfo;
import com.google.gson.Gson;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author hejiangwei
 * Created at 2018/6/28.
 */
public class Constants {
    private static final String TAG = Constants.class.getName();


    public static final String PACKAGE_NAME = "com.tencent.mm";
    public static final String TABLE_MESSAGE = "message";
    public static final String TABLE_USERINFO = "userinfo";
    public static final String TABLE_RCONTACT = "rcontact";
    public static final String TABLE_SNSCOMMENT = "SnsComment";
    public static final String WX_ROOT_PATH = "/data/data/com.tencent.mm/";
    public static final String WX_SP_UIN_PATH = WX_ROOT_PATH + "shared_prefs/auth_info_key_prefs.xml";
    //6.3.32
//    private String CLASS_INSER_DB =PACKAGE_NAME+ ".bh.e";
    //6.6.7
//    public static String CLASS_INSER_DB = PACKAGE_NAME+".bt.f";//g/h
    public static String CLASS_INSER_DB = "com.tencent.wcdb.database.SQLiteDatabase";
    public static String CLASS_BOTTOM = PACKAGE_NAME + ".ui.LauncherUI$c";
    public static String CLASS_ChattingList = PACKAGE_NAME + ".ui.conversation.d$14";
    public static String CLASS_ChattingListClick = PACKAGE_NAME + ".ui.LauncherUI";
    public static String CLASS_Cursor = PACKAGE_NAME + ".bt.h";
    public static String SELECT_USER_INFO = "select * from rcontact where username = '%s'";
    public static String SELECT_USER_SIZE = "select * from rcontact";
    public static String FLOAT_PACKAGE_NAME = "com.a85.floatingbtn";
    public static String FLOAT_LAUNCH = FLOAT_PACKAGE_NAME + ".Main2Activity";
    public static String FLOAT_Service_NAME = FLOAT_PACKAGE_NAME + ".service.FloatingMenuService";
    public static String Action_Chatting = "com.85.floatingbtn.ReceiveMsgReceiver.chatting";
    public static String Action_Message = "com.85.floatingbtn.ReceiveMsgReceiver.msg";
    public static String TAG_START_CHATTING = "startChatting";
    public static String TAG_CLOSE_CHATTING = "closeChatting";
    public static String TAG_ON_Create = "onCreate";
    public static String TAG_ON_RESUME = "onResume";
    public static String TAG_ON_STOP = "onStop";
    public static String TAG_INSERT = "insertWithOnConflict";
    public static String TAG_UPDATE = "updateWithOnConflict";
    public static String TAG_CURSOR = "b";
    public static String TAG_CHAT_MESSAGE = "chatMessage";

    public static String beanToString(Object object) {
        Gson gson = new Gson();
        return gson.toJson(object);
    }

    /**
     * 将时间戳转换为时间
     * "yyyy-MM-dd"
     * hh:mm:ss
     */
    public static String getstrDateFromTimeStamp(long lt, boolean isSecond, String strFomat) {
        String res;
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(strFomat);
        Date date = new Date(isSecond ? lt * 1000 : lt);
        res = simpleDateFormat.format(date);
        return res;
    }


}
